/**
 * 
 */
package com.zhanggz.mypattern.proxy;

/**
 * 计时代理
 * 
 * @author alex
 * @Date Jun 27, 2015
 */
public class CarTimerProxy implements Moveable {

	private Moveable m;

	/**
	 * 
	 */
	public CarTimerProxy(Moveable m) {
		super();
		this.m = m;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.zhanggz.mypattern.proxy.Moveable#move()
	 */
	public void move() {
		long starttime = System.currentTimeMillis();
		System.out.println("汽车开始行驶。。。");

		m.move();

		long endtime = System.currentTimeMillis();
		System.out.println("汽车结束行驶。。。汽车行驶时间：" + (endtime - starttime) + "毫秒！");
	}

}
